package com.gae;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.opensymphony.xwork2.ActionSupport;

public class GoogleLoginAction extends ActionSupport implements SessionAware{

	private static final long serialVersionUID = 1L;
	
	private Map<String, Object> session;

	private String loginURL;

	public String getLoginURL() {
		return loginURL;
	}

	public void setLoginURL(String loginURL) {
		this.loginURL = loginURL;
	}

	@Override
	public String execute() {
		
		UserService userService = UserServiceFactory.getUserService();
		this.loginURL = userService.createLoginURL("");
		
		return SUCCESS;
	}

	@Override
	public void setSession(Map<String, Object> map) {
		this.session = map;
		
	}

}
